package cn.csc.module.search.controller.admin.spu;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.search.controller.admin.spu.vo.SpuPageReqVO;
import cn.csc.module.search.controller.admin.spu.vo.SpuPageRespVO;
import cn.csc.module.search.service.spu.SpuService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuchuang
 * @version 1.0
 * @modify
 * @since 2025/3/19 15:55
 */
@Api(tags = "管理后台 - spu信息")
@RestController
@RequestMapping("/search/spu")
public class SpuController {


    @Autowired
    private SpuService spuService;

    @GetMapping("/getSkuAndStock")
    @Operation(summary = "获得Spu附带Sku和库存")
    public CommonResult<Page<SpuPageRespVO>> searchWithSkuAndStockOfPage(@RequestBody SpuPageReqVO reqVO){
        Page<SpuPageRespVO> spuPageRespVOS = spuService.searchWithSkuAndStockOfPage(reqVO);
        return CommonResult.success(spuPageRespVOS);
    }



}
